home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / info-service / gopher / NeXT / Tree0.5 / treeobj / gopher.h next >
Encoding:
C/C++ Source or Header  |  1992-05-16  |  1.7 KB  |  36 lines

  1. /* Each host/port has a Root structure. The branch in this Root is      */
  2. /* the first node in the tree with name '/'. The Root *next pointers    */
  3. /* form a linked list of Roots. This Branch *next pointers form a list  */
  4. /* of all of the branches leaving the current node. The Branch *sub     */
  5. /* pointers point to the Branch list for the node at the end of this    */
  6. /* Branch. The Branch *link pointers form connections outside the normal*/
  7. /* tree structure. They are "web" links between sites,etc... The *prev  */
  8. /* pointers point to the parent branch. The *root pointers point to the */
  9. /* Root for that node. There is a small amount of redundancy in this    */
  10. /* structure, but it simplified the programming.                        */
  11.  
  12. struct BRANCH {
  13.     char                name[46];    /* name (partial) of branch */
  14.     char                dname[60];    /* name displayed */
  15.     char                type;    /* type of branch */
  16.     unsigned short      level;    /* level in tree 0=root */
  17.     float               x, y, z;/* coordinates of this branch */
  18.     struct BRANCH      *next;    /* next branch from last node */
  19.     struct BRANCH      *sub;    /* sub-branch from this branch */
  20.     struct BRANCH      *link;    /* web link */
  21.     struct BRANCH      *prev;    /* up a layer */
  22.     struct ROOT        *root;    /* root for this branch */
  23. };
  24.  
  25. typedef struct BRANCH Branch;
  26.  
  27. struct ROOT {
  28.     unsigned long       addr;    /* inet addr of tree */
  29.     char                name[40];    /* name of host */
  30.     short               port;    /* port of gopher */
  31.     char                drawme;    /* draw me flag */
  32.     Branch              branch;    /* first branch */
  33.     struct ROOT        *next;    /* next tree */
  34. };
  35. typedef struct ROOT Root;
  36.